<%@ page language="java" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/struts-tiles" prefix="tiles" %>
<%@ taglib uri="/tags/faare" prefix="fa" %>

<HTML>
    <HEAD>
        <TITLE>Application menu and body</TITLE>
        <LINK rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/css/standard.css" />
    </HEAD>
    <BODY style="margin: 0; overflow: auto;" class="body_background">
        <!-- #### Horizontal Menu #### -->
        <TABLE cellpadding="0" cellspacing="0" border="0" width="100%" summary="Menu and body" class="body">
           <TR class="background">
              <TD><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="1" height="45" border="0" alt=""></TD>
              <TD width="100%">
                 <TABLE cellpadding="0" cellspacing="0" width="100%" border="0" summary="Top menu icons">
                    <TR>
                       <fa:getMenu id="Hmenu" name="horizontal_menu_edition" />
                       <logic:iterate id="elt" name="Hmenu" property="elements">
                          <TD><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="24" height="1" alt="" border="0"></TD>
                          <TD align="center">
                             <fa:showMenuElement name="elt" style="" basecontext="page"  />
                          </TD>
                       </logic:iterate>
                    </TR>
                 </TABLE>
              </TD>
              <TD align="center">
                 <html:link action="/showPerson" paramId="dn" paramName="user" paramProperty="dn" target="_self">
                    <NOBR>&nbsp;&nbsp;&nbsp;<bean:write name="user" property="commonName" />&nbsp;&nbsp;&nbsp;</NOBR>
                 </html:link>
                 <IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="1" height="8" border="0" alt=""><BR/>
                 <logic:empty name="user" property="profile">
                    <NOBR>&nbsp;&nbsp;&nbsp;Standard profile&nbsp;&nbsp;&nbsp;</NOBR>
                 </logic:empty>
                 <logic:notEmpty name="user" property="profile">
                    <html:link action="/showProfile" paramId="dn" paramName="user" paramProperty="dn" target="_parent">
                       <NOBR>&nbsp;&nbsp;&nbsp;<bean:write name="user" property="profile" />&nbsp;&nbsp;&nbsp;</NOBR>
                    </html:link>
                 </logic:notEmpty>
              </TD>
           </TR>
           <TR style="background-image: url('<%=request.getContextPath()%>/images/top_background_01.gif');">
              <TD><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="1" height="20" border="0" alt=""></TD>
              <TD width="100%" valign="middle"></TD>
              <TD width="100%" valign="middle"></TD>
           </TR>
        </TABLE>

        <!-- #### Body #### -->
		<script>
		   function doSearchUsers()
		   {
              document.personForm.action="<%=request.getContextPath()%>/showUsers.do";
              document.personForm.target="_parent";
			  document.personForm.submit();
		   }
		</script>
        <TABLE cellpadding="0" cellspacing="20" border="0" align="center" width="100%" summary="Body" class="body">
            <TR><TD valign="top" height="450" width="100%" align="center">
                    <TABLE cellpadding="0" cellspacing="0" border="0" summary="Body" class="body" align="center" width="100%" >
                        <TR><TD width="80%">
                                <TABLE cellpadding="0" cellspacing="0" border="0" summary="bottom" align="center">
                                    <TR><TD><IMG src="<%=request.getContextPath()%>/images/top_left_selected.gif" width="6" height="6" alt=""></TD>
                                        <TD class="background" width="100%"><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="100" height="1" alt=""></TD>
                                        <TD><IMG src="<%=request.getContextPath()%>/images/top_right_selected.gif" width="6" height="6" alt=""></TD>
                                    </TR>
                                </TABLE>
                            </TD>
                            <TD valign="top" width="200" rowspan="3">&nbsp;<IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="50" height="5" alt="" border="0"></TD>
                        </TR>
                        <TR><TD class="background">
                                <DIV style="margin: 15;">
								    <html:form action="/modifyPersonManager" styleId="modifPersonForm" method="POST" enctype="multipart/form-data" target="_self">
                                     <TABLE cellpadding="0" cellspacing="5" border="0" summary="Body" class="body">
                                       <TR>
									      <TD>
										  <TABLE cellpadding="0" cellspacing="5" border="0" summary="Body" class="body">
										  <TR>
                                          <TD width="60">
                                             <img src="ImageDispatcher?dn=<bean:write name='personForm' property='user.dn'/>&attname=photo" border="1" height="75">
										  </TD>
										  <TD class="name" align="left">
												<NOBR>&nbsp;<bean:write name="personForm" property="user.commonName" />&nbsp;</NOBR>
										  </TD>
										</TR>
										</TABLE>
									   </TD></TR>
									   </TR>
										<TR>
										  <TD><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="1" height="5" alt=""></TD>
										</TR>
<!-- TODO NOMINATIVE -->
                                        <TR><TD>
                                        <TABLE cellpadding="0" cellspacing="5" border="0" summary="Body" class="body">
										   <TR>
                                              <TD class="body">First&nbsp;Name&nbsp;:&nbsp;</TD>
											  <TD class="body"><bean:write name="personForm" property="user.givenName" /></TD>
                                           </TR>
										   <TR>
										       <TD class="body">Last&nbsp;Name&nbsp;:&nbsp;</TD>
											   <TD class="body"><bean:write name="personForm" property="user.name" /></TD>
										   </TR>
                                           <TR>
										       <TD class="body">User&nbsp;ID&nbsp;:&nbsp;</TD>
											   <TD class="body"><bean:write name="personForm" property="user.id" /></TD>
											</TR>
										</TABLE>
										</TD></TR>
<!-- TODO MANAGER -->
                                        <TR><TD>
										<TABLE cellpadding="0" cellspacing="5" border="0" summary="Body" class="body">
										   <TR>
         									<TD class="body">Manager&nbsp;:&nbsp;</TD>
											<logic:present name="personForm" property="managerPerson.commonName">
      	   									<TD class="body">
	     									   <NOBR><bean:write name="personForm" property="managerPerson.commonName"/></NOBR>
											</TD>
											</TR>
											<TR>
											  <TD>&nbsp;</TD>
											</logic:present>
											  <TD>
											  <NOBR><html:text name="personForm" property="manager"/>&nbsp;<INPUT type="button" name="browseManager" value="Search..." alt="Search..." title="Search..." onclick="doSearchUsers();"></NOBR>
											  </TD>
											</TR>
											<logic:present name="personForm" property="managerPerson.commonName">
											<TR>
											  <TD>&nbsp;</TD>
											  <TD>
											  <NOBR><html:checkbox name="personForm" property="deleteManager"/>&nbsp;Delete&nbsp;manager&nbsp;</NOBR>
											  </TD>
											</TR>
											</logic:present>
                                            <TR>
											   <TD class="body">Job&nbsp;title&nbsp;:&nbsp;</TD>
				    	    				   <TD class="body">
											   <html:select name="personForm" property="user.title">
                                                  <logic:iterate id="title" name="personForm" property="titlesList">
											        <option value="<bean:write name='title' scope='page'/>"><bean:write name="title" scope="page"/></option>
												  </logic:iterate>
											   </html:select>
                                               </TD>
											 </TR>
<!-- TODO DEPARTMENT -->
                                             <TR>
											    <TD class="body"><NOBR>Department&nbsp;:&nbsp;</NOBR></TD>
												<TD class="body">
											   <html:select name="personForm" property="user.department">
                                                  <logic:iterate id="department" name="personForm" property="departmentsList">
											        <option value="<bean:write name='department' scope='page'/>"><bean:write name="department" scope="page"/></option>
												  </logic:iterate>
											   </html:select>
                                              </TD>
											</TR>
									    </TABLE>
										</TD></TR>
                                        <TR><TD><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="1" height="5" alt=""></TD>
										</TR>
<!-- TODO CONTACT -->
                                        <TR><TD class="white_title">How to contact ?</TD></TR>
                                        <TR><TD>
                							<TABLE cellpadding="0" cellspacing="5" border="0" summary="Body" class="body">
											<TR>
     										   <TD class="body">T&eacute;l.&nbsp;:&nbsp;</TD>
											   <TD class="body"><html:text name="personForm" property="user.phone" /></TD>
	    									</TR>
                                            <TR>
										       <TD class="body">Fax.&nbsp;:&nbsp;</TD>
											   <TD class="body"><html:text name="personForm" property="user.fax" /></TD>
     										</TR>
											<TR>
											   <TD class="body">Email&nbsp;:&nbsp;</TD>
											   <TD class="body"><html:text name="personForm" property="user.mail" size="40" maxlength="100"/></TD>
											</TR>
											</TABLE>
											</TD>
										</TR>
                                        <TR><TD><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="1" height="5" alt=""></TD>
										</TR>

<!-- TODO FIND -->                      <TR><TD class="white_title">Where to find ?</TD></TR>
<!-- TODO Site -->                      <TR><TD>
                                           <TABLE cellpadding="0" cellspacing="5" border="0" summary="Body" class="body">
										   <TR>
										      <TD class="body">Site&nbsp;:&nbsp;</TD>
											  <TD class="body">
											   <html:select name="personForm" property="user.site">
                                                  <logic:iterate id="site" name="personForm" property="sitesList">
											        <option value="<bean:write name='site' scope='page'/>"><bean:write name="site" scope="page"/></option>
												  </logic:iterate>
											   </html:select>
										     </TD>
										   </TR>
                                           <TR>
										      <TD class="body">Room&nbsp;:&nbsp;</TD>
											  <TD class="body"><html:text name="personForm" property="user.roomNumber" /></TD>
                                           </TR>
										   </TABLE>
										</TD></TR>
                                        <TR><TD><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="1" height="5" alt=""></TD>
										</TR>
                                        <TR><TD class="white_title">Personal&nbsp;Comment</TD></TR>
										<TR><TD class="body">
<!-- TODO Description -->            							<!-- MULTI : description -->
                                            <html:textarea name="personForm" property="descrp" cols="40" rows="3"/>
										</TD></TR>
                                        <TR><TD><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="1" height="5" alt=""></TD>
										</TR>
										<TR>
										   <TD align="center">
										      <INPUT type="image" src="<%=request.getContextPath()%>/images/ok_button.gif" border="0" alt="Submit" title="Submit">
										   </TD>
        								</TR>
									</TABLE>
									</html:form>
                                </DIV>
                            </TD>
                        </TR>
                        <TR><TD width="80%">
                                <TABLE cellpadding="0" cellspacing="0" border="0" summary="bottom" align="center">
                                    <TR><TD><IMG src="<%=request.getContextPath()%>/images/bottom_left_selected.gif" width="6" height="6" alt=""></TD>
                                        <TD class="background" width="100%"><IMG src="<%=request.getContextPath()%>/images/spacer.gif" width="100" height="1" alt=""></TD>
                                        <TD><IMG src="<%=request.getContextPath()%>/images/bottom_right_selected.gif" width="6" height="6" alt=""></TD>
                                    </TR>
                                </TABLE>
                            </TD>
                        </TR>
                    </TABLE>
                </TD>
            </TR>
        </TABLE>
    </BODY>
</HTML>
